import type { PageParams } from "@/types/common"
import type { Role, RoleData, RoleDetail, RoleParams, RoleUserData } from "@/types/system"
import { request } from "@/utils/reuqest"
import { da } from "element-plus/es/locales.mjs"



// 获取角色列表
export const getRoleListAPI = () =>{
  return  request<Role[]>('/park/sys/role')
}

// 获取tree 权限列表
export const getTreeListAPI = () =>{
  return request<RoleData[]>('park/sys/permision/all/tree')
}

export const getRoleDetailAPI = (rowId:number)=>{
  return request<RoleDetail>(`park/sys/role/${rowId}`)
}

// 获取角色成员列表
export const getRoleUserAPI = (roleId:number,params?:PageParams )=>{
  return request<RoleUserData>(`park/sys/roleUser/${roleId}`,'GET',params)
}

// 角色管理 添加角色

export const createRoleUserAPI = (data: RoleParams)=>{
  return request('/park/sys/role','POST',data)
}